package com.lovebugs.xgrid.components;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lovebugs.OgnlContext;
import com.lovebugs.UIBean;

public class Column extends UIBean{
	
	private String id;

	private String text;

	private String width = "70";

	private boolean sortable = true;

	private String dataIndex;

	private String type;

	private String format;

	private String renderer;

	private boolean hidden = false;
	
	private String align = "left";
	
	private String map;
	
	private List<ColumnAction> columnactions = new ArrayList<ColumnAction>();

	public Column(OgnlContext ognlContext, HttpServletRequest req, HttpServletResponse resp) {
		super(ognlContext, req, resp);	
	}

	public void addComponent(UIBean subComponent) {
		if(subComponent instanceof ColumnAction) {
			columnactions.add((ColumnAction)subComponent);
		}
	}

	public String getAlign() {
		return align;
	}

	public void setAlign(String align) {
		this.align = align;
	}

	public String getDataIndex() {
		return dataIndex;
	}

	public void setDataIndex(String dataIndex) {
		this.dataIndex = dataIndex;
	}

	public String getFormat() {
		return format;
	}

	public void setFormat(String format) {
		this.format = format;
	}

	public boolean getHidden() {
		return hidden;
	}

	public void setHidden(boolean hidden) {
		this.hidden = hidden;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getMap() {
		return map;
	}

	public void setMap(String map) {
		this.map = map;
	}

	public String getRenderer() {
		return renderer;
	}

	public void setRenderer(String renderer) {
		this.renderer = renderer;
	}

	public boolean getSortable() {
		return sortable;
	}

	public void setSortable(boolean sortable) {
		this.sortable = sortable;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getWidth() {
		return width;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	public List<ColumnAction> getColumnactions() {
		return columnactions;
	}

	public void setColumnactions(List<ColumnAction> columnactions) {
		this.columnactions = columnactions;
	}
}
